//*****************************************************************************
//
// commomn.c - SimpleLink Driver code
//
// Copyright (c) 2009-2010 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup common_api
//! @{
//
//*****************************************************************************

#include "driver_common.h"
#include "socket.h"
#include "wlan.h"
#include "evnt_handler.h"

//*****************************************************************************
//
//! void __error__(char *pcFilename, unsigned long ulLine)
//!
//!  \param  pcFilename - file name, where error occurred
//!  \param  ulLine     - line number, where error occurred
//!
//!  \return none
//!
//!  \brief stub function for ASSERT macro
//
//*****************************************************************************
void
__error__(char *pcFilename, unsigned long ulLine)
{
    //TODO full up function
}


void 
SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams)
{
	//
	// In the blocking implementation the control to caller will be returned only after the 
	// end of current transaction
	//
	tSLInformation.usRxEventOpcode = usOpcode;
	hci_event_handler(pRetParams, 0, 0);
}


void 
SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from, unsigned char *fromlen)
{
	//
	// In the blocking implementation the control to caller will be returned only after the 
	// end of current transaction, i.e. only after data will be received
	//
	tSLInformation.usRxDataPending = 1;
	hci_event_handler(pBuf, from, fromlen);
}






//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
